Skip to content

chore: fix C lint errors (issue #6502) #6520

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

sahilk45
Copy link
Contributor

@sahilk45 sahilk45 commented Apr 2, 2025

Resolves #6502

Description

What is the purpose of this pull request?

This PR fixes the C linting error related to an uninitialized variable in the dabs2 benchmark length test file. The fix replaces variable-length arrays with dynamically allocated memory to ensure proper initialization and memory management.

Changes made:

  • Replaced VLAs with malloc-allocated arrays
  • Added proper memory allocation checks
  • Added memory cleanup with free() calls
  • Maintained the same functionality as the original code

This pull request:

  • Fixes the C linting error related to an uninitialized variable in the dabs2 benchmark length test file.

Related Issues

Does this pull request have any related issues?

This pull request:

Questions

Any questions for reviewers of this pull request?

No.

Other

Any other information relevant to this pull request? This may include screenshots, references, and/or implementation notes.

Maintained the same functionality as the original code

Checklist

Please ensure the following tasks are completed before submitting this pull request.


@stdlib-js/reviewers

@stdlib-bot stdlib-bot added Math Issue or pull request specific to math functionality. Needs Review A pull request which needs code review. labels Apr 2, 2025
@stdlib-bot
Copy link
Contributor

Coverage Report

Package Statements Branches Functions Lines
math/strided/special/dabs2 $\color{green}374/374$
$\color{green}+100.00\%$
$\color{green}15/15$
$\color{green}+100.00\%$
$\color{green}4/4$
$\color{green}+100.00\%$
$\color{green}374/374$
$\color{green}+100.00\%$

The above coverage report was generated for the changes in this PR.

@stdlib-bot stdlib-bot added the Potential Duplicate There might be another pull request resolving the same issue. label Jun 17, 2025
@kgryte kgryte removed Needs Review A pull request which needs code review. Potential Duplicate There might be another pull request resolving the same issue. labels Jun 22, 2025
@kgryte
Copy link
Member

kgryte commented Jun 22, 2025

This PR does more than what is needed to address the upstream issue and #7370 has now been merged. As such, I will go ahead and close.

@kgryte kgryte closed this Jun 22, 2025
@kgryte kgryte added the Duplicate This issue or pull request already exists. label Jun 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate This issue or pull request already exists. Math Issue or pull request specific to math functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix C lint errors
3 participants